package com.hwua.dao;

import com.hwua.entity.User;

import java.sql.SQLException;

public interface IUserDao {
    /**
     * 查询用户
     * @param user 实体类用户
     * @return
     * @throws Exception
     */
    public User query(User user) throws Exception;

    /**
     * 根据用户姓名查询
     * @param name user.getName()
     * @return
     * @throws Exception
     */
    public User query(String name) throws  Exception;

    /**
     * 修改密码的时候用
     * @param name
     * @param email
     * @return
     * @throws Exception
     */
    public User query(String name,String email) throws Exception;

    /**
     * 添加用户
     * @param user 实体类用户
     * @return
     * @throws Exception
     */
    public int insert(User user) throws Exception;

    /**
     * 更改密码
     * @param user 实体类
     * @return
     * @throws Exception
     */
    public int update(User user) throws Exception;
}
